<?php
namespace app\index\controller;
use think\Controller;
class Brand extends Controller 
{
    public function lst()
    {
		$data=array();
		$brandRes = db('brand')->order('id DESC')->paginate(4);
		// dump($brandRes);die;
		$data['totalPage']=$brandRes->lastPage(); //总共多少页
		$brands=$brandRes->items();  //当前页的总的对象
		$html='';
		$html.='<div class="brand-list" id="recommend_brands" ><ul>';
		foreach($brands as $k => $v){
			$html.='<li>
                <div class="brand-img"><a href="'.$v['brand_url'].'" target="_blank"><img src="'.config('view_replace_str.__uploads__').'/'.$v['brand_img'].'"></a></div>
                <div class="brand-mash">
                </div>
            </li>';
		}
		$html .= '</ul>
        <a href="javascript:void(0);" ectype="changeBrand" class="refresh-btn"><i class="iconfont icon-rotate-alt"></i><span>换一批</span></a>';
		$data['brands'] = $html;
		return json($data);
	}
	
}
